package com.cn.qgx428.lazydiary.Utils

import com.cn.qgx428.lazydiary.R

/**
 * 此类用来记录常量数组数据
 * Created by qinguanxiong on 2018/2/25.
 */
class RecordHelper {
    companion object {
        /**
         * 账单收入类型
         */
        fun getBillIncomeTypes()
            = listOf<String>(
                "工资",
                "兼职",
                "礼金",
                "长辈",
                "理财收益",
                "意外之财",
                "其他"
        )

        /**
         * 账单收入类型图标
         */
        fun getBillIncomeIcon() =
                listOf<Int>(
                        R.drawable.ic_salary,
                        R.drawable.ic_parttime,
                        R.drawable.ic_cash_git,
                        R.drawable.ic_elder,
                        R.drawable.ic_mmm,
                        R.drawable.ic_windfall,
                        R.drawable.ic_clown
                )

        /**
         * 账单支出类型
         */
        fun getBillExpendTypes()
            = listOf<String>(
                "一般",
                "餐饮",
                "购物",
                "服饰",
                "交通",
                "娱乐",
                "学习",
                "约会",
                "通讯",
                "零食",
                "美容",
                "旅行",
                "医疗",
                "书籍",
                "运动",
                "办公",
                "住房",
                "孩子",
                "长辈",
                "礼金",
                "理财",
                "装修",
                "其他"
        )

        /**
         * 获取账单支出类型Icon
         */
        fun getBillExpendIcons()=
                listOf<Int>(
                        R.drawable.ic_normal,
                        R.drawable.ic_catering,
                        R.drawable.ic_shop,
                        R.drawable.ic_cloth,
                        R.drawable.ic_traffic,
                        R.drawable.ic_entertainment,
                        R.drawable.ic_learn,
                        R.drawable.ic_date,
                        R.drawable.ic_communication,
                        R.drawable.ic_snacks,
                        R.drawable.ic_beauty,
                        R.drawable.ic_tour,
                        R.drawable.ic_medical_treatment,
                        R.drawable.ic_book,
                        R.drawable.ic_sport,
                        R.drawable.ic_work,
                        R.drawable.ic_house,
                        R.drawable.ic_kid,
                        R.drawable.ic_elder,
                        R.drawable.ic_cash_git,
                        R.drawable.ic_mmm,
                        R.drawable.ic_decoration,
                        R.drawable.ic_clown
                )

        fun getBillSummerize()=
                listOf<String>(
                        MConst.BILL_INCOME,
                        MConst.BILL_EXPEND
                )

        /**
         * 根据账单类型返回相应图标
         */
        fun getBillIcon(type: String, specific: String): Int{
            var iconPosition = 0
            var iconId = -1
            if (type.equals(MConst.BILL_INCOME)){
                iconPosition = getBillIncomeTypes().indexOf(specific)
                iconId = getBillIncomeIcon().get(iconPosition)
            } else if (type.equals(MConst.BILL_EXPEND)){
                iconPosition = getBillExpendTypes().indexOf(specific)
                iconId = getBillExpendIcons().get(iconPosition)
            } else{
                return R.drawable.ic_normal
            }
            return iconId
        }
    }
}